import { service } from '@/utils/request2'
import store from '../store/index';

// 获取信息授权信息
export function GetEmpower(appid) {
  return service({
    url: '/wechat/agent.index/config',
    method: 'post',
    data: {
      token: store.state.user.token,
      app_id: appid
    }
  })
}

// 配置微信授权
export function SetEmpower(appid, callback) {
  return service({
    url: '/wechat/agent.index/geturl',
    method: 'post',
    data: {
      token: store.state.user.token,
      app_id: appid,
      callback: callback
    }
  })
}
export function authUrl(appid, callback, token) {
  return service({
    url: '/agency/wechat.authorize/authUrl',
    method: 'post',
    data: {
      token: token,
      app_id: appid,
      callback: callback
    }
  })
}
export function auth_detail(appid, type, token) {
  return service({
    url: "/agency/wechat.authorize/auth_detail",
    method: "post",
    data: {
      app_id: appid,
      type: type,
      token: token
    }
  });
}
